package com.juyu.miliao.api.dao.mysql;

import com.juyu.miliao.api.domain.CoolSummerActivities;
import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author xuanqicheng
 */
@Repository
public class CoolSummerActivitiesDao {

    @Autowired
    private SqlSession sqlSession;

    @Cacheable(value = "timeout-cache-getCoolSummerActivitiesList")
    public List<CoolSummerActivities> getCoolSummerActivitiesList(){
        return sqlSession.selectList("getCoolSummerActivitiesList");
    }

    public CoolSummerActivities getCoolSummerActivitiesById(int id){
        return sqlSession.selectOne("getCoolSummerActivitiesById",id);
    }
}
